<style lang="scss" scoped>
dl {
    display: flex;
    align-items: center;
    margin: 15px 0;
}
</style>
<template>
    <div v-for="(v, i) in doctorList" :key="i">
        <div v-if="v.texttype === '语音'">
            <dl @click="onDetail(v)">
                <dt>
                    <img :src="v.textimage" alt="" style="width: 150px;height: 90px;border: 1px solid #f2f2f2;">
                </dt>
                <dd>
                    <p style="font-size: 14px;font-weight: 900;"> <span
                            style="background-color: rgb(248, 236, 198);color: orange;font-size: 12px;padding: 3px;border-radius: 3px;">
                            {{ v.texttype }} </span> 脊髓型颈椎症引发什么症状</p>

                    <p style="font-size: 13px;margin-left: 5px;"><van-text-ellipsis rows="2"
                            :content="v.textdescword" />
                    </p>
                    
                </dd>
            </dl>
         <p style="line-height: 40px;"> <img :src="v.textimage" style="width: 30px;height: 30px;border-radius: 50%;" alt="">高璐  | 主治医师 济宁医学院附属医院  </p>

        </div>
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { useRouter } from 'vue-router';
import { ref } from 'vue';
import type { ListItemState } from '../../interView/indexView'
const doctorList = ref<ListItemState[]>([])
const router = useRouter()
const getList = async () => {
    const res = await axios.get('/api/book/list', { params: { pageCode: 1, pageSize: 7 } })
    console.log(res);
    doctorList.value =res.data.data
    console.log(doctorList.value);
}

const onDetail = (v: ListItemState) => {
    router.push({
        path: `/detail3/${v.textid}`
    })
}


getList()
</script>